<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>手机端登录</title>
    <script src="http://47.106.66.89:8080/js/vue.min.js"></script>
    <script src="http://47.106.66.89:8080/js/axios.min.js"></script>
    <script src="js/mobile.js"></script>
    <script src="/auth/js/auth.js"></script>
    <style>
        * {
            font-size: 1.5rem;
        }
    </style>
</head>
<body style="margin: 10vh;" onload="init()">
<h1>允许PC端登录</h1>
<form id="ff" action="/auth/login" method="post" style="display: grid; gap:10px">
    <input type="button" value="登录" onclick="allowAutoLogin()">
</form>
<script>
    function init() {
        if(!localStorage.getItem("autoLoginUid")){
            localStorage.setItem("backConfirm", "1");
            localStorage.setItem("backConfirmParam", location.search);
            location.href="login.html";
        }
    }
    function allowAutoLogin(){
        let param = location.search;
        let uid = localStorage.getItem("autoLoginUid");
        param += "&uid=" + uid;
        axios.get("/user/autoLogin/allowAutoLogin"+param).then(function (res) {
           if(res.data.code == 1){
               ff.innerHTML=res.data.msg;
           } else {
               alert(res.data.msg);
           }
        });
    }
</script>

</body>
</html>